 <!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>玩家列表</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/animate.css" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/style.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>玩家列表</h5>
                        <div class="ibox-tools">                           
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row ">
                        <form method="get" action="{:U('Admin/Gamer/gamerList')}">
                            <div class="col-sm-3 m-b-xs">
                                <select class="input-sm form-control input-s-sm inline" name="keywords">
                                    <option value="">请选择搜索字段</option>
                                    <option value="gamer_id" <eq name='keywords' value='gamer_id'>selected='selected'</eq>>ID</option>
                                    <option value="openid" <eq name='keywords' value='openid'>selected='selected'</eq>>玩家ID</option>
                                    <option value="nickname" <eq name='keywords' value='nickname'>selected='selected'</eq>>昵称</option>
                                    <!-- <option value="phone" <eq name='keywords' value='phone'>selected='selected'</eq>>手机号</option> -->
                                    
                                </select>
                            </div>
                            <div class="col-sm-4">
                                <div class="input-group">
                                    <input type="text" placeholder="请输入关键词" class="input-sm form-control" value="{$keyvalue}" name="keyvalue"> <span class="input-group-btn">
                                        <button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
                                </div>
                            </div>
                        </form>
                        </div>
                    </div>
                    <div class="ibox-content">

                        <table class="table table-bordered table-hover">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>玩家ID</th>
                                    <th>昵称</th>
                                    <!-- <th>手机号</th> -->
                                    <th>初始房卡数</th>
                                    <th>充值总数</th>
                                    <th>消费总数</th>
                                    <th>游戏总局数</th>
                                    <th>注册时间</th>
                                    <!-- <th>状态</th>
                                    <th>操作</th> -->
                                </tr>
                            </thead>
                            <tbody>
                            <empty name='adminList'>
                            <tr>
                                <td colspan="12">没有相关数据！</td>
                            </tr>
                            
                            </empty>
                            <foreach name='adminList' item='v'>
                                <tr>
                                    <td>{$v.gamer_id}</td>
                                    <td>{$v.openid}</td>
                                    <td>{$v.nickname}</td>
                                    <!-- <td>{$v.phone}</td> -->
                                    <td>{$v.init_pay}</td>
                                    <td>
                                    <eq name='v.total_pay' value='0'>0<else/>
                                    <a href="{:U('Admin/Gamer/payList')}?keywords=openid&keyvalue={$v.openid}">{$v.total_pay}</a>
                                    </eq>
                                    </td>
                                    <td>
                                    <eq name='v.total_consume' value='0'>0<else/>
                                    <a href="{:U('Admin/Gamer/consumeList')}?keywords=openid&keyvalue={$v.openid}">{$v.total_consume}</a>
                                    </eq>
                                    </td>
                                    <td>
                                    <eq name='v.total_play' value='0'>0<else/>
                                    <a href="{:U('Admin/Gamer/recordList')}?keywords=openid&keyvalue={$v.openid}">{$v.total_play}</a>
                                    </eq>
                                    </td>
                                    <td>{$v.addtime}</td>
                                    <!-- <td><switch name='v.status'>
                                    <case value='0' > <span class="cgreen">正常</span></case>
                                    <case value='1' ><span class="cred">封停</span></case>
                                    </switch></td>
                                    <td><a href="#" onclick="blacklist({$v.gamer_id},{$v.status})"><switch name='v.status'>
                                    <case value='0'>封停</case>
                                    <case value='1'>解封</case>
                                    </switch></a></td> -->
                                </tr>
                            </foreach> 
                            </tbody>
                                
                        </table>
                        {$page}
                    </div>
                </div>
            </div>

        </div>
    </div>

    <!-- 全局js -->
    <script src="__PUBLIC__/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="__PUBLIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>



    <!-- Peity -->
    <script src="__PUBLIC__/admin/js/plugins/peity/jquery.peity.min.js"></script>

    <!-- 自定义js -->
    <script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>


    <!-- iCheck -->
    <script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>

    <!-- Peity -->
    <!-- <script src="__PUBLIC__/admin/js/demo/peity-demo.js"></script> -->

    <script>
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
        });

    function blacklist(gamer_id,status){
        if (status=='1') {
            var act='解封';
            var status=0;
        }else{
            var act='封停';
            var status=1;
        }
     if(confirm("确定要"+act+"该代理吗？")){
     $.ajax({
             type:'post',
             url:"{:U('Admin/Gamer/blacklist')}?gamer_id="+gamer_id+"&status="+status,
             dataType:'json',
             success:function(data){ 
                if (data=='success') {
                    alert(act+'成功！');
                    window.location.href="{:U('Admin/Gamer/gamerList')}";
                }else{
                    alert(act+'失败！');                                          
                }                          
             }
         })
     }
    
}
    </script>

    
    

</body>

</html>
